<template>
	<view class="w-full" :style="{height: height + 'px'}">
		<video id="myVideo" :src="src" :initial-time="initialTime" :poster="poster" :autoplay="autoplay"
			object-fit="cover" style="width: 100%;height: 100%;" @timeupdate="$emit('timeupdate', $event)"
			@error="videoErrorCallback" @pause="$emit('pause', $event)" controls></video>
	</view>
</template>

<script>
	export default {
		name:"my_video",
		props: {
			height: {
				type: Number,
				default: 200
			},
			src: {
				type: String,
				default: ''
			},
			poster: {
				type: String,
				default: ''
			},
			autoplay: {
				type: Boolean,
				default: false
			},
			initialTime: {
				type: Number,
				default: 0
			},
		},
		data() {
			return {
				
			}
		},
		methods: {
			videoErrorCallback (e) {
				console.log(e);
			}
		}
	}
</script>

<style>

</style>